<?php

namespace app\admin\controller;
use my\Redis;

class SmsCode extends Base {


    //积分规则设置
    public function index(){
        if(input('post.')){
            $redis = new Redis();
            $type = input('post.type');
            $key  = $type.":".input('post.phone');
            $code = $redis->get($key);
            if(!empty($code)){
                echo ajax_success($code);die;
            }else{
                echo ajax_error('未获取到验证码');die;
            }
        }
        return $this->fetch();
    }


}
